package cn.grf.datasource.flex.service;

import cn.grf.datasource.flex.pojo.User;
import cn.grf.datasource.flex.pojo.mapper.UserMapper;
import lombok.RequiredArgsConstructor;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author grf
 * @apiNote
 * @since 2025/4/23
 */
@Service
@RequiredArgsConstructor
public class UserService {
    private final UserMapper userMapper;


    public void insert(User user) {
        userMapper.insert(user);
    }

    public List<User> list() {
        return userMapper.selectAll();
    }

    public User get(Long id) {
        return userMapper.selectOneById(id);
    }
}
